<div class="hero-unit">
  <h1>Ardtweeno Gateway</h1>
  <% if running %>
  <p>is online and the SerialParser subsystem is: <span class="label label-success">active</span></p>
  <% else %>
  <p>is online but the SerialParser subsystem is: <span class="label label-warning">inactive</span></p>
  <div class="alert alert-info">
    <button type="button" class="close" data-dismiss="alert">&times;</button>
    <h4>Info</h4>
    <p>
  	  Attempt to start the SerialParser?
      <button onclick="startGateway();" class="btn btn-small btn-inverse">Start</button>
    </p>
  
  </div>
  <% end %>
</div>

<div class="row">
  <div class="span5">
  	<h3>Zone Information</h3>
    <table class="table table-striped">
      <thead>
        <th>Name</th>
        <th>Nodes</th>
      </thead>
      <tbody>
      <% unless zones.nil? %>
        <% zones.each do |i| %>
        <tr>
          <td><%= i["zonename"] %></td>
          <td><%= i["nodes"] %></td>
        </tr>
        <% end %>
      <% end %>
      </tbody>
    </table>
  </div>
  <div class="span5">
  	<h3>Last 5 Packets</h3>
    <table class="table table-striped">
      <thead>
        <th>Date</th>
        <th>Time</th>
        <th>Name</th>
        <th>PacketNo</th>
        <th>Data</th>
      </thead>
      <tbody>
      <% unless packets.nil? %>
        <% packets.each do |i| %>
        <tr>
          <td><%= i["date"] %></td>
          <td><%= i["hour"] + ":" + i["minute"] %></td>
          <td><%= i["node"] %></td>
          <td><%= i["seqNo"] %></td>
          <td><%= i["data"] %></td>
        </tr>
        <% end %>
      <% end %>
      </tbody>
    </table>
  </div>
</div>
